home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / tex / lametex_.z / lametex_ / lametex / page / page_skew.ps < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.2 KB  |  73 lines

  1. %! page_skew.ps     - A page turned at at 30 degree angle
  2. %% This is a LameTeX Page Description File written in PostScript.
  3. %% Postscript Code by Jon Monsarrat Copyright 1992
  4. %% permission given for anything except selling this or deleting the header.
  5.  
  6. %%%%%%%%%%%%%%%% width height angle left bot Skew-Page %%%%%%%%%%%%%%%%%%%%%%
  7. % Draws a twisted page at ang degrees, given margins and size
  8. /Skew-Page
  9. {
  10.                                         % wp hp ang lp bp
  11.   moveto dup cos exch sin 2 copy        % wp hp cosang sinang cosang sinang 
  12.   5 index mul exch 6 -1 roll mul        % hp cosang sinang sinwpang coswpang
  13.   5 2 roll 2 index mul neg 3 1 roll mul % sinwpang coswpang -sinhpang coshpang
  14.   2 index 4 index rlineto               % sinwpang coswpang -sinhpang coshpang
  15.   rlineto neg exch neg rlineto          % -empty-
  16.   closepath
  17. } bind def
  18.  
  19. %%%%%%%%%%%  icon-name  LeftMarginIcon   - %%%%%%%%%%%%
  20. % Given the name of an icon, executes the icon in the left margin.
  21. /LeftMarginIcon
  22. {
  23.   gsave
  24.        bslot 50 sub ypos 72 sub translate cvx exec
  25.   grestore
  26. } bind def
  27.  
  28. %% REQUIRED DEFINITIONS START HERE %%
  29.  
  30. /PageShape
  31. {
  32.   8.5 in 11 in 30 0 0 Skew-Page 
  33.   currentflat 8 mul
  34. } bind def
  35.  
  36. % Anything to do when a new page is started
  37. /StartPage
  38. {
  39.   0 0 moveto -30 rotate
  40. } bind def
  41.  
  42. % Anything to do when a new page is ended
  43. /EndPage
  44. {
  45.    pagenumber 4 string cvs
  46.    dup stringwidth pop 8.5 in
  47.    formatdict /rightmargin get sub
  48.    formatdict /leftmargin get sub 
  49.    exch sub 2 div formatdict /leftmargin get add
  50.    formatdict /bottommargin get 2 div moveto show
  51.    /pagenumber pagenumber 1 add def
  52.    showpage  % A new page here really does mean start a new page.
  53. } bind def
  54.  
  55. %% INITIALIZATION TO DO WHEN FILE IS LOADED %%
  56. % Page-specific defaults that describe the page.
  57. /InitPage
  58. {
  59.   /evenodd true def   % if true use even-odd rule; false means winding rule
  60.   /fillout false def  % true means fill outside shape. false is inside.
  61.  
  62.   /in {72 mul} def
  63.   /BM 0 def       % Bottom Margin
  64.   /TM 11 in def   % Top Margin
  65.   /LM 0 def       % Left Margin
  66.   /RM 8.5 in def  % Right Margin
  67.  
  68.   userdict /pagenumber known not   % Initialize pagenumber if not done already
  69.   { userdict begin /pagenumber 1 def end} if
  70. } bind def
  71.  
  72. InitPage        % Just loading this file initializes the page.
  73.